<template>
    <div>
      <nav-top :title="from.title" :goback="true"/>
        <v-progress-linear
            color="rgb(4, 190, 2)"
            v-show="progress"
            indeterminate
            rounded
            height="2"
        ></v-progress-linear>
        <v-container style="">
            <div
            max-width="90%"
            class="mx-auto co">
                <h2 class="text-center" style="padding:24px">{{ from.title }}</h2>
                <p style="padding:24px">{{ from.desc }}</p>
                <v-row>
                <v-col cols="12">
                  <p style="padding:24px">尊敬的{{ from.name }}我们已收到您的咨询请求，我们将在48小时内与您取得联系！</p>
                </v-col>
                </v-row>
                <v-btn @click="tel" width="100%" color="rgb(4, 190, 2)" style="margin-top: 24px;color:#fff"> 客服电话 </v-btn>
            </div>    
        </v-container>
    </div>
</template>

<script>
import { GetWorkOrderFromInfo, URLP, orderstatus } from './../../libs/api_v1'
export default {
  data:()=>({
    from:{
        title:'',
        desc:'',
        audio:'',
        images:'',
        name:'',
        contact:'',
        time:'',
      },
      fromimages:''
  }),
  created:function(){
    let order_no = URLP("order_no")
    if(order_no){ 
      GetWorkOrderFromInfo(order_no,this.$cookies.get("authtoken"))
      .then((resp)=>{
        var res = resp.data
        if(res.code == 1){
          this.from.name = res.data.name
          this.from.contact = res.data.contact
          this.from.time = res.data.time_slot
          this.from.title = res.data.title
          this.from.desc = res.data.desc
          this.from.audio = res.data.audio
          this.fromimages = res.data.images.split(",")
          console.log(this.fromimages)
        }else{
          // alert(res.msg)
          this.$store.commit('setAlert',{icon:'close',text: res.msg,show:true})
          window.location.href = '/user/self'
          // window.location.href = "/workorder/create/order"
        }
      })
      .catch((err)=>{

        this.$store.commit('setAlert',{icon:'close',text:err,show:true})
      })
    }else{
      this.$store.commit('setAlert',{icon:'close',text:"错误的访问",show:true})
    }
  },
  methods:{
    tel:function(){
      window.location.href = "tel:075584326358"
    },
  }
}
</script>

